<SCRIPT LANGUAGE="JavaScript">  
    function validation()
    {
        var temp="";
        temp=document.getElementById('JobseekerFirstName').value;
        if( temp.length==0 )
        {
            document.getElementById('JobseekerFirstName').focus();
            document.getElementById('JobseekerFirstName').style.backgroundColor='#FFC';
            alert("Please fill your first name");
            document.getElementById('JobseekerFirstName').style.backgroundColor='#FFF';
            return false;             
        }        
        temp=document.getElementById('JobseekerGender').value; 
        if(temp=='Male' && ( document.getElementById('JobseekerSalution').value=='Ms.' || document.getElementById('JobseekerSalution').value=='Mrs.') )
        {
            document.getElementById('JobseekerGender').focus();
            document.getElementById('JobseekerGender').style.backgroundColor='#FFC';
            alert('Your type of Gender and Salution are missmatch');
            document.getElementById('JobseekerGender').style.backgroundColor='#FFF';
            return false;
        }
        if(temp=='Female' && document.getElementById('JobseekerSalution').value=='Mr.' )
        {
            document.getElementById('JobseekerGender').focus();
            document.getElementById('JobseekerGender').style.backgroundColor='#FFC';
            alert('Your type of Gender and Salution are missmatch');
            document.getElementById('JobseekerGender').style.backgroundColor='#FFF';
            return false;
        }        
        temp=document.getElementById('JobseekerReligionId').value;
        if( temp=="" )
        {
            document.getElementById('JobseekerReligionId').focus();
            document.getElementById('JobseekerReligionId').style.backgroundColor='#FFC';
            alert("Please fill your religion");
            document.getElementById('JobseekerReligionId').style.backgroundColor='#FFF';
            return false;             
        }        

        temp=document.getElementById('JobseekerAddress').value;
        if( temp.length==0 )
        {
            document.getElementById('JobseekerAddress').focus();
            document.getElementById('JobseekerAddress').style.backgroundColor='#FFC';
            alert("Please fill your address");
            document.getElementById('JobseekerAddress').style.backgroundColor='#FFF';
            return false;             
        }          
        
        temp=document.getElementById('JobseekerPostalCode').value;
        if( isNaN(temp) && temp!='' )
        {
            document.getElementById('JobseekerPostalCode').focus();
            document.getElementById('JobseekerPostalCode').style.backgroundColor='#FFC';
            alert("Postal code must be numeric");
            document.getElementById('JobseekerPostalCode').style.backgroundColor='#FFF';
            return false;             
        }
        
        if( document.getElementById('JobseekerHomeNo').value=='' && document.getElementById('JobseekerMobileNo').value=='' )
        {
            document.getElementById('JobseekerMobileNo').focus();
            document.getElementById('JobseekerHomeNo').style.backgroundColor='#FFC';
            document.getElementById('JobseekerMobileNo').style.backgroundColor='#FFC';
            alert("Please provide at least one phone number");
            document.getElementById('JobseekerHomeNo').style.backgroundColor='#FFF';
            document.getElementById('JobseekerMobileNo').style.backgroundColor='#FFF';
            return false;             
        }        
        
                                   
    }
    
</SCRIPT>
<?php 
echo "<table class='table_resume'><tr>";
    echo "<td valign='top' width='260px'>";
    echo $this->element('menu_resume'); 
    echo "</td>";
    echo "<td class='pemisah'></td>";
    echo "<td valign='top'>";
    echo "<div class='form'>";
    echo "<h2> Personal Detail </h2>";
    echo "<hr color='#2A7EF7'>";
        echo "<div class='kotak2'>";     
        echo $form->create('Jobseeker',array('action'=>'personal_detail','onsubmit'=>'return validation();'));
            echo "<div class='input'><label> &nbsp </label>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span class='red'>*</span> <b>Required Field</b></div>";
            echo $form->input('id');
            echo $form->input('salution', array( 'options'=>array('Mr.'=>'Mr.','Ms.'=>'Ms.','Mrs.'=>'Mrs.','Dr.'=>'Dr.') ) );
            echo $form->input('first_name',array ('maxLength'=>'20','after'=>"<span class='red'><sup>*</sup></span>"));
            echo $form->input('last_name',array ('Family/Last Name','maxLength'=>'20'));
            echo $form->input('nasionalism', array( 'options'=>array('WNI'=>'WNI','WNA'=>'WNA') ) );
            echo $form->input('gender', array( 'options'=>array('Male'=>'Male','Female'=>'Female'),'after'=>"<span class='red'><sup>*</sup></span>" ) );
            $maxyear=date("Y")-10;
            $minyear=$maxyear-30;
            echo $form->input('date_of_birth',array( 'dateFormat'=>'DMY', 'minYear'=>$minyear, 'maxYear'=>$maxyear,'after'=>"<span class='red'><sup>*</sup></span>"));
		    echo $form->input('ethnic',array ('maxLength'=>'10','after'=>"<span class='red'><sup>*</sup></span>"));
            echo $form->input('member',array ( 'options'=>array('Microsoft'=>'Microsoft', 'Linux'=>'Linux')));
            echo $form->input('martial_status', array( 'empty'=>' ', 'options'=>array('Single'=>'Single','Married'=>'Married') ) );
		    echo $form->input('religion_id',array('after'=>"<span class='red'><sup>*</sup></span>" ));
            echo "<table cellspacing='8px'><tr><td><h3>Contact Info</h3></td><td width='420px'><hr color='#aaa'></td></tr></table>";
            echo $form->input('email',array( 'disabled'=>'true' ));
		    echo $form->input('address',array('size'=>'40', 'after'=>"<span class='red'><sup>*</sup></span>"));
		    echo $form->input('city_id',array('after'=>"<span class='red'><sup>*</sup></span>"));
			echo $form->input('Skill',array('id'=>'list_skill','style'=>'height:200px;width:150px;'));
		    echo $form->input('postal_code');
		    echo $form->input('home_no',array('after'=>"<span class='red'><sup>*</sup></span>"));
		    echo $form->input('mobile_no',array('after'=>"<span class='red'><sup>*</sup></span>"));
            echo "<div class='input'><label> &nbsp </label><input type='submit' value='Save & Next'></div>";
        echo "</form>";
        echo "</div>";
        echo ":. <span class='red'>*</span> Required Field";
        echo "<br>:. Untuk mengubah email Anda, silakan kunjungi ";
        echo $html->link(__('[ Edit Account ]', true), array('action'=>'edit_acount'));
    echo "</div>";
    echo "</td>";
echo "</tr></table>";
?>
